<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>上传广告图片页面</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	
	$(function(){
		msgFadeIn();
		showImage();
	});
	
	function msgFadeIn(){
		var msg = $("#msg").text();
		if(msg != null || msg != ''){
			$("#msg").animate({color:"red"},3000,function(){
				$("#msg").fadeIn(1000,function(){
					$("#msg").text("");
				});
			});
			
		}
	}
	
	function showImage(){
		var imageName = $("#imageName").val();
		if(imageName != ''){
			var show = " <p>这是您刚刚上传的图片：</p> "+
					   " <img alt='上传的图片' style='width: 450px; height: 250px;' src='${pageContext.request.contextPath}/userImages/carousel/"+imageName+"'> ";
			$("#imageShow").append(show);
		}
	}
</script>
</head>
<body style="margin: 10px">
<div id="p" class="easyui-panel" title="上传广告图片" style="padding: 10px">
 	<form action="${pageContext.request.contextPath}/admin/adpic/save.do" method="post" enctype="multipart/form-data">
 		 <div style="margin-top: 8px;margin-bottom: 10px;font-size: 14px;">请选择您要上传的广告图片:</div>
 		 <input type="file" name="fileItem" style="border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;border-right: 1px solid #ccc;border-radius: 4px;cursor: pointer;"/>
         <span id="msg" style="color: red;">${msg}</span>
         <br>
         <input id="submit" type="submit" value="上传" style="width: 70px; height: 25px;border: 1px solid #aaa;border-radius: 5px;margin-top: 10px;" />
    </form>
    <input type="hidden" value="${imageName }" id="imageName" name="imageName"/>
    <div style="padding: 10px;margin-top: 10px;" id="imageShow">
    	<%-- <p>这是您刚刚上传的图片：</p>
    	<img alt="上传的图片" style="width: 450px; height: 250px;" src="${pageContext.request.contextPath}/static/userImages/carousel/${imageName}"> --%>
    </div>
 </div>
 
</body>
</html>